<?php

/**
 * RecepcionEmails form base class.
 *
 * @method RecepcionEmails getObject() Returns the current form's model object
 *
 * @package    costabravasfr
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseRecepcionEmailsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'vivienda'           => new sfWidgetFormInputText(),
      'email'              => new sfWidgetFormInputText(),
      'emailvalid'         => new sfWidgetFormChoice(array('choices' => array('y' => 'y', 'n' => 'n'))),
      'datainici'          => new sfWidgetFormDate(),
      'datafin'            => new sfWidgetFormDate(),
      'mensaje'            => new sfWidgetFormTextarea(),
      'casasvisitadas'     => new sfWidgetFormTextarea(),
      'idioma'             => new sfWidgetFormInputText(),
      'enews'              => new sfWidgetFormChoice(array('choices' => array('y' => 'y', 'n' => 'n'))),
      'ip'                 => new sfWidgetFormInputText(),
      'fechahorarecepcion' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'vivienda'           => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'email'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'emailvalid'         => new sfValidatorChoice(array('choices' => array(0 => 'y', 1 => 'n'), 'required' => false)),
      'datainici'          => new sfValidatorDate(array('required' => false)),
      'datafin'            => new sfValidatorDate(array('required' => false)),
      'mensaje'            => new sfValidatorString(),
      'casasvisitadas'     => new sfValidatorString(),
      'idioma'             => new sfValidatorString(array('max_length' => 3, 'required' => false)),
      'enews'              => new sfValidatorChoice(array('choices' => array(0 => 'y', 1 => 'n'), 'required' => false)),
      'ip'                 => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'fechahorarecepcion' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('recepcion_emails[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'RecepcionEmails';
  }

}
